package test.enba.generator;

import com.enba.boot.generator.generator.AutoGeneratorHelper;
import javax.annotation.PostConstruct;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@MapperScan("test.enba.generator.generator.mapper")
@SpringBootApplication
public class GeneratorApplication {

  @Autowired(required = false)
  private AutoGeneratorHelper autoGeneratorHelper;

  public static void main(String[] args) {
    SpringApplication.run(GeneratorApplication.class, args);
  }

  @PostConstruct
  public void generator() {
    if (autoGeneratorHelper != null) {
      autoGeneratorHelper.generator();
    }
  }
}
